package com.hhj.service.impl;

import com.hhj.dao.BillDao;
import com.hhj.pojo.Bill;
import com.hhj.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BillServiceImpl implements BillService {

    @Autowired
    @Qualifier("billDao")
    private BillDao billDao;


    @Override
    public boolean add(Bill bill) {
        int add = billDao.add(bill);
        if (add>0){
            return true;
        }
        return false;
    }

    @Override
    public List<Bill> getBillList(Bill bill) {
        return billDao.getBillList(bill);
    }

    @Override
    public boolean deleteBillById(String delId) {
        int i = billDao.deleteBillById(delId);
        if (i>0){
            return true;
        }
        return false;
    }

    @Override
    public Bill getBillById(String id) {
        return billDao.getBillById(id);
    }

    @Override
    public boolean modify(Bill bill) {
        int modify = billDao.modify(bill);
        if (modify>0){
            return true;
        }
        return false;
    }
}
